package dancereal;

public class J28_PrinterInterface {
	/* 인터페이스를 사용하지 않은 경우
	 * 프린터 제조사를 예를 듦
	 * 
	 */
	
	public static void main(String[] args) {
	
	HPPrinter h = new HPPrinter();
	h.speedPrint();
	
	CanonPrinter c = new CanonPrinter();
	c.hyperPrint();
	
	EpsonPrinter e = new EpsonPrinter();
	e.nanoPrint();

	HPPrinterDriver hp = new HPPrinterDriver();
	hp.print();
	
	CanonPrinterDriver cp = new CanonPrinterDriver();
	cp.print();
	
	EpsonPrinterDriver ep = new EpsonPrinterDriver();
	ep.print();
	
	// 인터페이스를 이용한 다형성
	
	Printable p = new HPPrinterDriver();
	p.print();
	p = new CanonPrinterDriver();
	p.print();
	p = new EpsonPrinterDriver();
	p.print();
	}

	
}

class HPPrinter{
	public void speedPrint(){
		System.out.println("빠른 출력속도!! - HP");
	}
}

class CanonPrinter{
	public void hyperPrint(){
		System.out.println("절대속도에 도전 - Canon");
	}
}

class EpsonPrinter{
	public void nanoPrint(){
		System.out.println("눈깜빡할 속도 - Epson");
	}
	
}

interface Printable {
	public void print();
	
}

class HPPrinterDriver implements Printable{
	@Override
	public void print() {
		System.out.println("빠른 출력속도!! - HP");
	}
	
}

class CanonPrinterDriver implements Printable{
	@Override
	public void print() {
		System.out.println("절대속도에 도전 - Canon");
	}
	
	
}

class EpsonPrinterDriver implements Printable{
	@Override
	public void print() {
		System.out.println("눈깜빡할 속도 - Epson");
	}
	
}